package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the SOLICITUD_X_CARGA database table.
 * 
 */
@Embeddable
public class SolicitudXCargaPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private long solicitudId;
	private String rol;

    public SolicitudXCargaPK() {
    }

	@Column(name="SOLICITUD_ID", unique=true, nullable=false)
	public long getSolicitudId() {
		return this.solicitudId;
	}
	public void setSolicitudId(long solicitudId) {
		this.solicitudId = solicitudId;
	}

	@Column(unique=true, nullable=false, length=2)
	public String getRol() {
		return this.rol;
	}
	public void setRol(String rol) {
		this.rol = rol;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof SolicitudXCargaPK)) {
			return false;
		}
		SolicitudXCargaPK castOther = (SolicitudXCargaPK)other;
		return 
			(this.solicitudId == castOther.solicitudId)
			&& this.rol.equals(castOther.rol);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.solicitudId ^ (this.solicitudId >>> 32)));
		hash = hash * prime + this.rol.hashCode();
		
		return hash;
    }
}